package com.usian.order.controller;


import com.usian.common.Result;
import com.usian.entity.OrderDetails;
import com.usian.order.service.IOrderDetailsService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-01-15
 */
@RestController
@RequestMapping("/order/order-details")
public class OrderDetailsController {

    @Autowired
    private IOrderDetailsService orderDetailsService;

    @Operation(summary = "根据订单id查询订单详情")
    @GetMapping("/getOrderDetailsByOrderId/{orderId}")
    public Result<OrderDetails> getOrderDetailsByOrderId(@PathVariable Integer orderId){
        return orderDetailsService.getOrderDetailsByOrderId(orderId);
    }
}
